package lancooPaperAnswer;

import android.content.Context;
import android.text.Editable;
import android.text.Html;
import android.text.TextWatcher;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.Animation;
import android.view.animation.RotateAnimation;
import android.webkit.WebView;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.example.hyznbk.R;
import com.example.hyznbk.presenter.PaperDef;

import org.apache.commons.lang3.StringEscapeUtils;

import lancooControl.Control;
import lancooTktEditText.TktAnswerEditText;

import static android.view.View.GONE;
import static testPaperCTCS.GuessTestingPaperActivity.InforGuessTesting;
import static testPaperFavoritesPage.FavoritesPagePaperActivity.InforFavoritesPage;
import static testPaperJBFX.BasicReviewPaperActivity.InforBasicReview;
import static testPaperNDFX.DifficultReviewPaperActivity.InforDifficultReview;
import static testPaperWrong.WrongQuesPaperActivity.InforWrongQues;
import static testPaperWrongHistory.HistoryWrongQuesPaperActivity.InforHistoryWrongQues;

/**
 * Created by Administrator on 2017/10/13/013.
 */

public class AnswerTktAdapter extends BaseAdapter

{

    private LayoutInflater mInflater;
    private Context mContext;
    //当前试题数量
    private int SumItem;
    //当前试题在当前试卷的ID
    private int PaperID;
    //当前问题小题所在大题的ID
    private int OptionID;
    private int ModelFrom;//试卷来源

    private int tvBlack;
    private int tvBlue;
    private int tvWhite;
    private int tvGreen;
    private int tvRed;


    private ViewHolder holder = null;
    private class ViewHolder {
//        TextView TvItemIndex;//小题编号
//        TextView TvItemContent;//小题文本题干区
        WebView WvContent;
        LinearLayout LayoutStuAnswerEdt;//作文输入区
        LinearLayout LayoutAnalysis;//答案回看解析区
//        TextView TvStuAnswer;//我的答案
        LinearLayout LayoutStuAnswer;//我的答案显示区域
//        TextView TvAnswer;//参考答案
        LinearLayout LayoutAnswer;//参考答案显示区域
        TextView TvScore;//得分
        TextView TvAnalysis;//解析
//        TextView TvStuAssess;//自评
        LinearLayout LayoutAssess;//自评显示区域
        LinearLayout LayoutScore;//回看得分
        TextView TvAnswerAmount;//小题总数

        LinearLayout LayoutClassicExample;//经典案例显示区
        LinearLayout LayoutClassicMenu;//参考答案及解析按钮
        ImageView IvClassic;//参考答案及解析箭头
        LinearLayout LayoutClassic;//参考答案及解析显示区
//        TextView TvClassicAnswer;//参考答案
        LinearLayout LayoutClassicAnswer;////参考答案显示区域
        TextView TvClassicAnalysis;//解析
        private ViewHolder(View convertView) {
//            TvItemIndex = (TextView) convertView.findViewById(R.id.tv_item_index);
//            TvItemContent = (TextView) convertView.findViewById(R.id.tv_item_content);
            WvContent = (WebView) convertView.findViewById(R.id.wv_content);
            LayoutStuAnswerEdt = (LinearLayout) convertView.findViewById(R.id.layout_stu_answer_edt);
            LayoutAnalysis = (LinearLayout) convertView.findViewById(R.id.layout_analysis);
//            TvStuAnswer = (TextView) convertView.findViewById(R.id.tv_stu_answer);
            LayoutStuAnswer = (LinearLayout) convertView.findViewById(R.id.layout_stu_answer);
//            TvAnswer = (TextView) convertView.findViewById(R.id.tv_answer);
            LayoutAnswer = (LinearLayout) convertView.findViewById(R.id.layout_answer);
            TvScore = (TextView) convertView.findViewById(R.id.tv_score);
            TvAnalysis = (TextView) convertView.findViewById(R.id.tv_analysis);
//            TvStuAssess = (TextView) convertView.findViewById(R.id.tv_stu_assess);
            LayoutAssess = (LinearLayout) convertView.findViewById(R.id.layout_assess);
            LayoutScore = (LinearLayout) convertView.findViewById(R.id.layout_score);
            TvAnswerAmount = (TextView) convertView.findViewById(R.id.tv_answer_amount);


            LayoutClassicExample = (LinearLayout) convertView.findViewById(R.id.layout_classic_example);
            LayoutClassicMenu = (LinearLayout) convertView.findViewById(R.id.layout_classic_menu);
            LayoutClassicMenu.setOnClickListener(new clickListener());
            IvClassic = (ImageView) convertView.findViewById(R.id.iv_classic);
            LayoutClassic = (LinearLayout) convertView.findViewById(R.id.layout_classic);
//            TvClassicAnswer = (TextView) convertView.findViewById(R.id.tv_classic_answer);
            LayoutClassicAnswer = (LinearLayout) convertView.findViewById(R.id.layout_classic_answer);
            TvClassicAnalysis = (TextView) convertView.findViewById(R.id.tv_classic_analysis);

        }
    }

    /*
   * 获取小题选项信息
   * */
    private int itemIndex ;//小题编号
    private String itemContent;//题干信息
    private String quesImage ;//题干图片信息
    private int state;//试卷的作答状态
    private int isAssess;//本题是否可自评
    private String stuAssess;//自评/机评结果
    private String stuAnswer;//用户答案
    private int SmallQuesTotalCount;//计算小题个数
    private String answer;//正确答案
    private double score;//试题总分值
    private String analysis;//答案解析
    private String macAssess;//机评
    private int totalItemCount;//小题数量
    private int allSmallQuesItemTotalCount ;//总的空数量
    public AnswerTktAdapter(Context context, int sumItem, int paperID, int optionID, int modelFrom) {
        mInflater = LayoutInflater.from(context);
        this.mContext = context;
        this.SumItem = sumItem;
        this.PaperID = paperID;
        this.OptionID = optionID;
        this.ModelFrom = modelFrom;
    }

    @Override
    public int getCount() {
        return SumItem;
    }

    @Override
    public Object getItem(int position) {
        return position;
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(final int position, View convertView, ViewGroup parent) {
        // TODO Auto-generated method stub

        if (convertView == null) {
            convertView = mInflater.inflate(R.layout.adapter_answer_tkt_item, null);
            holder = new ViewHolder(convertView);
            convertView.setTag(holder);
        } else {
            holder = (ViewHolder) convertView.getTag();
        }

        /*
        * 获取作文题用户相关信息
        * */
        getInfor();

        /*
        * 显示题干信息
        * */
        showContent();

        /*
        * 写入用户作答信息
        * */
        setEdtStuAnswer();

        /*
        * 显示用户回看解析相关信息
        */
        showAnalysis();

        return convertView;
    }


    private String[] smallQueAnswer;
    private String[] smallQuesStuAnswer;
    private String[] smallQuesAssess;
    private int smallQuesAllAmount;
    private double smallQuesScore;
    /*
    * 获取作文题用户相关信息
    * */
    private void  getInfor(){

        tvBlack = mContext.getResources().getColor(R.color.black);
        tvBlue = mContext.getResources().getColor(R.color.blue);
        tvWhite = mContext.getResources().getColor(R.color.white);
        tvGreen = mContext.getResources().getColor(R.color.green);
        tvRed = mContext.getResources().getColor(R.color.red);

        if(ModelFrom== PaperDef.FROM_BASE_REVIEW) {
            itemIndex = InforBasicReview.getPaperContent().get(PaperID).getQueList().get(OptionID).getItemIndex();
            itemContent = InforBasicReview.getPaperContent().get(PaperID).getQueList().get(OptionID).getItemContent();
            quesImage = InforBasicReview.getPaperContent().get(PaperID).getQuesImage();
            stuAnswer = InforBasicReview.getPaperContent().get(PaperID).getQueList().get(OptionID).getStuAnswer();
            state = InforBasicReview.getState();
            answer = InforBasicReview.getPaperContent().get(PaperID).getQueList().get(OptionID).getAnswer();
            score = InforBasicReview.getPaperContent().get(PaperID).getScore();
            analysis = InforBasicReview.getPaperContent().get(PaperID).getQueList().get(OptionID).getAnalysis();
            stuAssess = InforBasicReview.getPaperContent().get(PaperID).getQueList().get(OptionID).getStuAssess();
            totalItemCount = InforBasicReview.getPaperContent().get(PaperID).getTotalItemCount();
            allSmallQuesItemTotalCount = 0;
            for(int i=0;i<totalItemCount;i++) {
                allSmallQuesItemTotalCount = allSmallQuesItemTotalCount + Control.backSum(
                        InforBasicReview.getPaperContent().get(PaperID).getQueList().get(i).getAnswer(), "$、") + 1;
            }


            if(stuAnswer.equals("")){
                for(int i=0;i<Control.backSum(answer,"$、");i++) {
                    stuAnswer = stuAnswer + "$、";
                }
            }
            if(stuAssess.equals("")){
                for(int i=0;i<Control.backSum(answer,"$、");i++) {
                    stuAssess = stuAssess + "$、";
                }
            }
            InforBasicReview.getPaperContent().get(PaperID).getQueList().get(OptionID).setStuAnswer(stuAnswer);
            InforBasicReview.getPaperContent().get(PaperID).getQueList().get(OptionID).setStuAssess(stuAssess);
            Log.e("=====answer=======","===="+answer);
            Log.e("=====stuAnswer=======","===="+stuAnswer);
            Log.e("=====stuAssess=======","===="+stuAssess);


            String stuAnswerAll = "";
            String stuAssessAll = "";
            for (int i = 0; i < totalItemCount; i++) {
                if(i==0){
                    stuAnswerAll = InforBasicReview.getPaperContent().get(PaperID).getQueList().get(i).getStuAnswer();
                    stuAssessAll = InforBasicReview.getPaperContent().get(PaperID).getQueList().get(i).getStuAssess();
                }else{
                    stuAnswerAll = stuAnswerAll+"#$*#"+InforBasicReview.getPaperContent().get(PaperID).getQueList().get(i).getStuAnswer();
                    stuAssessAll = stuAssessAll+"#$*#"+InforBasicReview.getPaperContent().get(PaperID).getQueList().get(i).getStuAssess();
                }
            }
            InforBasicReview.getPaperContent().get(PaperID).setStuAnswerOldAll(stuAnswerAll);
            InforBasicReview.getPaperContent().get(PaperID).setStuAssessOldAll(stuAssessAll);
            InforBasicReview.getPaperContent().get(PaperID).setStuAnswerNewAll(stuAnswerAll);
            InforBasicReview.getPaperContent().get(PaperID).setStuAssessNewAll(stuAssessAll);

            Log.e(">>>>>allall>>>>", "==AnswerNewAll==00==:"+ InforBasicReview.getPaperContent().get(PaperID).getStuAnswerNewAll());
            Log.e(">>>>>allall>>>>", "==AnswerOldAll==11==:"+InforBasicReview.getPaperContent().get(PaperID).getStuAnswerOldAll());
            Log.e(">>>>>allall>>>>", "==AssessNewAll==22==:"+InforBasicReview.getPaperContent().get(PaperID).getStuAssessNewAll());
            Log.e(">>>>>allall>>>>", "==AssessOldAll==33==:"+InforBasicReview.getPaperContent().get(PaperID).getStuAssessOldAll());


            SmallQuesTotalCount = Control.backSum(answer,"$、")+1;
            smallQueAnswer = new String[SmallQuesTotalCount];
            smallQuesStuAnswer = new String[SmallQuesTotalCount];
            smallQuesAssess = new String[SmallQuesTotalCount];
            Log.e(">>>>>000888>>>>AAAAA>>", "==SmallQuesTotalCount====:"+SmallQuesTotalCount);
            for(int i=0;i<SmallQuesTotalCount;i++){
                smallQueAnswer[i] = Control.returnArray(answer,"$、",2)[i];
            }

            for(int i=0;i<SmallQuesTotalCount;i++){
                if(stuAnswer.equals("")){
                    smallQuesStuAnswer[i] = "";
                }else {
                    smallQuesStuAnswer[i] = Control.returnArray(stuAnswer, "$、", 2)[i];
                }
            }

            for(int i=0;i<SmallQuesTotalCount;i++){
                if(stuAssess.equals("")){
                    smallQuesAssess[i] = "";
                }else {
                    smallQuesAssess[i] = Control.returnArray(stuAssess, "$、", 2)[i];
                }
            }

            smallQuesAllAmount = 0;
            for(int i=0;i<totalItemCount;i++){
                smallQuesAllAmount = smallQuesAllAmount + Control.backSum(InforBasicReview.getPaperContent().get(PaperID).getQueList().get(i).getAnswer(),"$、")+1;
            }
            smallQuesScore = score/smallQuesAllAmount;

        }else if(ModelFrom==PaperDef.FROM_DIFFERENT_REVIEW){
            itemIndex = InforDifficultReview.getQueList().get(OptionID).getItemIndex();
            itemContent = InforDifficultReview.getQueList().get(OptionID).getItemContent();
            quesImage = InforDifficultReview.getQuesImage();
            stuAnswer = InforDifficultReview.getQueList().get(OptionID).getStuAnswer();
            state = InforDifficultReview.getState();
            answer = InforDifficultReview.getQueList().get(OptionID).getAnswer();
            score = InforDifficultReview.getScore();
            analysis = InforDifficultReview.getQueList().get(OptionID).getAnalysis();
            stuAssess = InforDifficultReview.getQueList().get(OptionID).getStuAssess();
            totalItemCount = InforDifficultReview.getTotalItemCount();
            allSmallQuesItemTotalCount = 0;
            for(int i=0;i<totalItemCount;i++) {
                allSmallQuesItemTotalCount = allSmallQuesItemTotalCount + Control.backSum(
                        InforDifficultReview.getQueList().get(i).getAnswer(), "$、") + 1;
            }

            String stuAnswerAll = "";
            String stuAssessAll = "";
            for (int i = 0; i < totalItemCount; i++) {
                if(i==0){
                    stuAnswerAll = InforDifficultReview.getQueList().get(i).getStuAnswer();
                    stuAssessAll = InforDifficultReview.getQueList().get(i).getStuAssess();
                }else{
                    stuAnswerAll = stuAnswerAll+"#$*#"+InforDifficultReview.getQueList().get(i).getStuAnswer();
                    stuAssessAll = stuAssessAll+"#$*#"+InforDifficultReview.getQueList().get(i).getStuAssess();
                }
            }
            InforDifficultReview.setStuAnswerOldAll(stuAnswerAll);
            InforDifficultReview.setStuAssessOldAll(stuAssessAll);
            InforDifficultReview.setStuAnswerNewAll(stuAnswerAll);
            InforDifficultReview.setStuAssessNewAll(stuAssessAll);

            Log.e(">>>>>allall>>>>", "==AnswerNewAll==00==:"+ InforDifficultReview.getStuAnswerNewAll());
            Log.e(">>>>>allall>>>>", "==AnswerOldAll==11==:"+InforDifficultReview.getStuAnswerOldAll());
            Log.e(">>>>>allall>>>>", "==AssessNewAll==22==:"+InforDifficultReview.getStuAssessNewAll());
            Log.e(">>>>>allall>>>>", "==AssessOldAll==33==:"+InforDifficultReview.getStuAssessOldAll());


            SmallQuesTotalCount = Control.backSum(answer,"$、")+1;
            smallQueAnswer = new String[SmallQuesTotalCount];
            smallQuesStuAnswer = new String[SmallQuesTotalCount];
            smallQuesAssess = new String[SmallQuesTotalCount];
            Log.e(">>>>>000888>>>>AAAAA>>", "==SmallQuesTotalCount====:"+SmallQuesTotalCount);
            for(int i=0;i<SmallQuesTotalCount;i++){
                smallQueAnswer[i] = Control.returnArray(answer,"$、",2)[i];
            }

            for(int i=0;i<SmallQuesTotalCount;i++){
                if(stuAnswer.equals("")){
                    smallQuesStuAnswer[i] = "";
                }else {
                    smallQuesStuAnswer[i] = Control.returnArray(stuAnswer, "$、", 2)[i];
                }
            }

            for(int i=0;i<SmallQuesTotalCount;i++){
                if(stuAssess.equals("")){
                    smallQuesAssess[i] = "";
                }else {
                    smallQuesAssess[i] = Control.returnArray(stuAssess, "$、", 2)[i];
                }
            }

            smallQuesAllAmount = 0;
            for(int i=0;i<totalItemCount;i++){
                smallQuesAllAmount = smallQuesAllAmount + Control.backSum(InforDifficultReview.getQueList().get(i).getAnswer(),"$、")+1;
            }
            smallQuesScore = score/smallQuesAllAmount;

        }else if(ModelFrom==PaperDef.FROM_GUESS_REVIEW){
            itemIndex = InforGuessTesting.getPaperContent().get(PaperID).getQueList().get(OptionID).getItemIndex();
            itemContent = InforGuessTesting.getPaperContent().get(PaperID).getQueList().get(OptionID).getItemContent();
            quesImage = InforGuessTesting.getPaperContent().get(PaperID).getQuesImage();
            stuAnswer = InforGuessTesting.getPaperContent().get(PaperID).getQueList().get(OptionID).getStuAnswer();
            state = InforGuessTesting.getState();
            answer = InforGuessTesting.getPaperContent().get(PaperID).getQueList().get(OptionID).getAnswer();
            score = InforGuessTesting.getPaperContent().get(PaperID).getScore();
            analysis = InforGuessTesting.getPaperContent().get(PaperID).getQueList().get(OptionID).getAnalysis();
            stuAssess = InforGuessTesting.getPaperContent().get(PaperID).getQueList().get(OptionID).getStuAssess();
            totalItemCount = InforGuessTesting.getPaperContent().get(PaperID).getTotalItemCount();
            allSmallQuesItemTotalCount = 0;
            for(int i=0;i<totalItemCount;i++) {
                allSmallQuesItemTotalCount = allSmallQuesItemTotalCount + Control.backSum(
                        InforGuessTesting.getPaperContent().get(PaperID).getQueList().get(i).getAnswer(), "$、") + 1;
            }

            String stuAnswerAll = "";
            String stuAssessAll = "";
            for (int i = 0; i < totalItemCount; i++) {
                if(i==0){
                    stuAnswerAll = InforGuessTesting.getPaperContent().get(PaperID).getQueList().get(i).getStuAnswer();
                    stuAssessAll = InforGuessTesting.getPaperContent().get(PaperID).getQueList().get(i).getStuAssess();
                }else{
                    stuAnswerAll = stuAnswerAll+"#$*#"+InforGuessTesting.getPaperContent().get(PaperID).getQueList().get(i).getStuAnswer();
                    stuAssessAll = stuAssessAll+"#$*#"+InforGuessTesting.getPaperContent().get(PaperID).getQueList().get(i).getStuAssess();
                }
            }
            InforGuessTesting.getPaperContent().get(PaperID).setStuAnswerOldAll(stuAnswerAll);
            InforGuessTesting.getPaperContent().get(PaperID).setStuAssessOldAll(stuAssessAll);
            InforGuessTesting.getPaperContent().get(PaperID).setStuAnswerNewAll(stuAnswerAll);
            InforGuessTesting.getPaperContent().get(PaperID).setStuAssessNewAll(stuAssessAll);

            Log.e(">>>>>allall>>>>", "==AnswerNewAll==00==:"+ InforGuessTesting.getPaperContent().get(PaperID).getStuAnswerNewAll());
            Log.e(">>>>>allall>>>>", "==AnswerOldAll==11==:"+InforGuessTesting.getPaperContent().get(PaperID).getStuAnswerOldAll());
            Log.e(">>>>>allall>>>>", "==AssessNewAll==22==:"+InforGuessTesting.getPaperContent().get(PaperID).getStuAssessNewAll());
            Log.e(">>>>>allall>>>>", "==AssessOldAll==33==:"+InforGuessTesting.getPaperContent().get(PaperID).getStuAssessOldAll());


            SmallQuesTotalCount = Control.backSum(answer,"$、")+1;
            smallQueAnswer = new String[SmallQuesTotalCount];
            smallQuesStuAnswer = new String[SmallQuesTotalCount];
            smallQuesAssess = new String[SmallQuesTotalCount];
            Log.e(">>>>>000888>>>>AAAAA>>", "==SmallQuesTotalCount====:"+SmallQuesTotalCount);
            for(int i=0;i<SmallQuesTotalCount;i++){
                smallQueAnswer[i] = Control.returnArray(answer,"$、",2)[i];
            }

            for(int i=0;i<SmallQuesTotalCount;i++){
                if(stuAnswer.equals("")){
                    smallQuesStuAnswer[i] = "";
                }else {
                    smallQuesStuAnswer[i] = Control.returnArray(stuAnswer, "$、", 2)[i];
                }
                Log.e(">>>>>KKKKK>>>>>", "==stuAnswer====:"+stuAnswer+"===smallQuesStuAnswer====="+smallQuesStuAnswer[i]);
            }

            for(int i=0;i<SmallQuesTotalCount;i++){
                if(stuAssess.equals("")){
                    smallQuesAssess[i] = "";
                }else {
                    smallQuesAssess[i] = Control.returnArray(stuAssess, "$、", 2)[i];
                }
            }

            smallQuesAllAmount = 0;
            for(int i=0;i<totalItemCount;i++){
                smallQuesAllAmount = smallQuesAllAmount + Control.backSum(InforGuessTesting.getPaperContent().get(PaperID).getQueList().get(i).getAnswer(),"$、")+1;
            }
            smallQuesScore = score/smallQuesAllAmount;

        }else if(ModelFrom==PaperDef.FROM_BASE_REVIEW_WRONG||ModelFrom==PaperDef.FROM_DIFFERENT_REVIEW_WRONG){
            itemIndex = InforWrongQues.get(PaperID).getQueList().get(OptionID).getItemIndex();
            itemContent = InforWrongQues.get(PaperID).getQueList().get(OptionID).getItemContent();
            quesImage = InforWrongQues.get(PaperID).getQuesImage();
            stuAnswer = InforWrongQues.get(PaperID).getQueList().get(OptionID).getStuAnswer();
            state = InforWrongQues.get(PaperID).getState();
            answer = InforWrongQues.get(PaperID).getQueList().get(OptionID).getAnswer();
            score = InforWrongQues.get(PaperID).getScore();
            analysis = InforWrongQues.get(PaperID).getQueList().get(OptionID).getAnalysis();
            stuAssess = InforWrongQues.get(PaperID).getQueList().get(OptionID).getStuAssess();
            totalItemCount = InforWrongQues.get(PaperID).getTotalItemCount();
            allSmallQuesItemTotalCount = 0;
            for(int i=0;i<totalItemCount;i++) {
                allSmallQuesItemTotalCount = allSmallQuesItemTotalCount + Control.backSum(
                        InforWrongQues.get(PaperID).getQueList().get(i).getAnswer(), "$、") + 1;
            }

            String stuAnswerAll = "";
            String stuAssessAll = "";
            for (int i = 0; i < totalItemCount; i++) {
                if(i==0){
                    stuAnswerAll = InforWrongQues.get(PaperID).getQueList().get(i).getStuAnswer();
                    stuAssessAll = InforWrongQues.get(PaperID).getQueList().get(i).getStuAssess();
                }else{
                    stuAnswerAll = stuAnswerAll+"#$*#"+InforWrongQues.get(PaperID).getQueList().get(i).getStuAnswer();
                    stuAssessAll = stuAssessAll+"#$*#"+InforWrongQues.get(PaperID).getQueList().get(i).getStuAssess();
                }
            }
            InforWrongQues.get(PaperID).setStuAnswerOldAll(stuAnswerAll);
            InforWrongQues.get(PaperID).setStuAssessOldAll(stuAssessAll);
            InforWrongQues.get(PaperID).setStuAnswerNewAll(stuAnswerAll);
            InforWrongQues.get(PaperID).setStuAssessNewAll(stuAssessAll);

            Log.e(">>>>>allall>>>>", "==AnswerNewAll==00==:"+ InforWrongQues.get(PaperID).getStuAnswerNewAll());
            Log.e(">>>>>allall>>>>", "==AnswerOldAll==11==:"+InforWrongQues.get(PaperID).getStuAnswerOldAll());
            Log.e(">>>>>allall>>>>", "==AssessNewAll==22==:"+InforWrongQues.get(PaperID).getStuAssessNewAll());
            Log.e(">>>>>allall>>>>", "==AssessOldAll==33==:"+InforWrongQues.get(PaperID).getStuAssessOldAll());


            SmallQuesTotalCount = Control.backSum(answer,"$、")+1;
            smallQueAnswer = new String[SmallQuesTotalCount];
            smallQuesStuAnswer = new String[SmallQuesTotalCount];
            smallQuesAssess = new String[SmallQuesTotalCount];
            Log.e(">>>>>000888>>>>AAAAA>>", "==SmallQuesTotalCount====:"+SmallQuesTotalCount);
            for(int i=0;i<SmallQuesTotalCount;i++){
                smallQueAnswer[i] = Control.returnArray(answer,"$、",2)[i];
            }

            for(int i=0;i<SmallQuesTotalCount;i++){
                if(stuAnswer.equals("")){
                    smallQuesStuAnswer[i] = "";
                }else {
                    smallQuesStuAnswer[i] = Control.returnArray(stuAnswer, "$、", 2)[i];
                }
            }

            for(int i=0;i<SmallQuesTotalCount;i++){
                if(stuAssess.equals("")){
                    smallQuesAssess[i] = "";
                }else {
                    smallQuesAssess[i] = Control.returnArray(stuAssess, "$、", 2)[i];
                }
            }

            smallQuesAllAmount = 0;
            for(int i=0;i<totalItemCount;i++){
                smallQuesAllAmount = smallQuesAllAmount + Control.backSum(InforWrongQues.get(PaperID).getQueList().get(i).getAnswer(),"$、")+1;
            }
            smallQuesScore = score/smallQuesAllAmount;


        }else if(ModelFrom==PaperDef.FROM_BASE_REVIEW_WRONG_History||ModelFrom==PaperDef.FROM_DIFFERENT_REVIEW_WRONG_History){
            itemIndex = InforHistoryWrongQues.get(PaperID).getQueList().get(OptionID).getItemIndex();
            itemContent = InforHistoryWrongQues.get(PaperID).getQueList().get(OptionID).getItemContent();
            quesImage = InforHistoryWrongQues.get(PaperID).getQuesImage();
            stuAnswer = InforHistoryWrongQues.get(PaperID).getQueList().get(OptionID).getStuAnswer();
            state = InforHistoryWrongQues.get(PaperID).getState();
            answer = InforHistoryWrongQues.get(PaperID).getQueList().get(OptionID).getAnswer();
            score = InforHistoryWrongQues.get(PaperID).getScore();
            analysis = InforHistoryWrongQues.get(PaperID).getQueList().get(OptionID).getAnalysis();
            stuAssess = InforHistoryWrongQues.get(PaperID).getQueList().get(OptionID).getStuAssess();
            totalItemCount = InforHistoryWrongQues.get(PaperID).getTotalItemCount();
            allSmallQuesItemTotalCount = 0;
            for(int i=0;i<totalItemCount;i++) {
                allSmallQuesItemTotalCount = allSmallQuesItemTotalCount + Control.backSum(
                        InforHistoryWrongQues.get(PaperID).getQueList().get(i).getAnswer(), "$、") + 1;
            }

            String stuAnswerAll = "";
            String stuAssessAll = "";
            for (int i = 0; i < totalItemCount; i++) {
                if(i==0){
                    stuAnswerAll = InforHistoryWrongQues.get(PaperID).getQueList().get(i).getStuAnswer();
                    stuAssessAll = InforHistoryWrongQues.get(PaperID).getQueList().get(i).getStuAssess();
                }else{
                    stuAnswerAll = stuAnswerAll+"#$*#"+InforHistoryWrongQues.get(PaperID).getQueList().get(i).getStuAnswer();
                    stuAssessAll = stuAssessAll+"#$*#"+InforHistoryWrongQues.get(PaperID).getQueList().get(i).getStuAssess();
                }
            }
            InforHistoryWrongQues.get(PaperID).setStuAnswerOldAll(stuAnswerAll);
            InforHistoryWrongQues.get(PaperID).setStuAssessOldAll(stuAssessAll);
            InforHistoryWrongQues.get(PaperID).setStuAnswerNewAll(stuAnswerAll);
            InforHistoryWrongQues.get(PaperID).setStuAssessNewAll(stuAssessAll);

            Log.e(">>>>>allall>>>>", "==AnswerNewAll==00==:"+ InforHistoryWrongQues.get(PaperID).getStuAnswerNewAll());
            Log.e(">>>>>allall>>>>", "==AnswerOldAll==11==:"+InforHistoryWrongQues.get(PaperID).getStuAnswerOldAll());
            Log.e(">>>>>allall>>>>", "==AssessNewAll==22==:"+InforHistoryWrongQues.get(PaperID).getStuAssessNewAll());
            Log.e(">>>>>allall>>>>", "==AssessOldAll==33==:"+InforHistoryWrongQues.get(PaperID).getStuAssessOldAll());


            SmallQuesTotalCount = Control.backSum(answer,"$、")+1;
            smallQueAnswer = new String[SmallQuesTotalCount];
            smallQuesStuAnswer = new String[SmallQuesTotalCount];
            smallQuesAssess = new String[SmallQuesTotalCount];
            Log.e(">>>>>000888>>>>AAAAA>>", "==SmallQuesTotalCount====:"+SmallQuesTotalCount);
            for(int i=0;i<SmallQuesTotalCount;i++){
                smallQueAnswer[i] = Control.returnArray(answer,"$、",2)[i];
            }

            for(int i=0;i<SmallQuesTotalCount;i++){
                if(stuAnswer.equals("")){
                    smallQuesStuAnswer[i] = "";
                }else {
                    smallQuesStuAnswer[i] = Control.returnArray(stuAnswer, "$、", 2)[i];
                }
            }

            for(int i=0;i<SmallQuesTotalCount;i++){
                if(stuAssess.equals("")){
                    smallQuesAssess[i] = "";
                }else {
                    smallQuesAssess[i] = Control.returnArray(stuAssess, "$、", 2)[i];
                }
            }

            smallQuesAllAmount = 0;
            for(int i=0;i<totalItemCount;i++){
                smallQuesAllAmount = smallQuesAllAmount + Control.backSum(InforHistoryWrongQues.get(PaperID).getQueList().get(i).getAnswer(),"$、")+1;
            }
            smallQuesScore = score/smallQuesAllAmount;

        }else if(ModelFrom== PaperDef.FROM_FAVOURITE_REVIEW) {
            itemIndex = InforFavoritesPage.getQueList().get(OptionID).getItemIndex();
            itemContent = InforFavoritesPage.getQueList().get(OptionID).getItemContent();
            quesImage = InforFavoritesPage.getQuesImage();
            stuAnswer = InforFavoritesPage.getQueList().get(OptionID).getStuAnswer();
            state = InforFavoritesPage.getState();
            answer = InforFavoritesPage.getQueList().get(OptionID).getAnswer();
            score = InforFavoritesPage.getScore();
            analysis = InforFavoritesPage.getQueList().get(OptionID).getAnalysis();
            stuAssess = InforFavoritesPage.getQueList().get(OptionID).getStuAssess();
            totalItemCount = InforFavoritesPage.getTotalItemCount();
            allSmallQuesItemTotalCount = 0;
            for(int i=0;i<totalItemCount;i++) {
                allSmallQuesItemTotalCount = allSmallQuesItemTotalCount + Control.backSum(
                        InforFavoritesPage.getQueList().get(i).getAnswer(), "$、") + 1;
            }

            SmallQuesTotalCount = Control.backSum(answer,"$、")+1;
            smallQueAnswer = new String[SmallQuesTotalCount];
            smallQuesStuAnswer = new String[SmallQuesTotalCount];
            smallQuesAssess = new String[SmallQuesTotalCount];
            Log.e(">>>>>000888>>>>AAAAA>>", "==SmallQuesTotalCount====:"+SmallQuesTotalCount);
            for(int i=0;i<SmallQuesTotalCount;i++){
                smallQueAnswer[i] = Control.returnArray(answer,"$、",2)[i];
            }

            for(int i=0;i<SmallQuesTotalCount;i++){
                if(stuAnswer.equals("")){
                    smallQuesStuAnswer[i] = "";
                }else {
                    smallQuesStuAnswer[i] = Control.returnArray(stuAnswer, "$、", 2)[i];
                }
            }

            for(int i=0;i<SmallQuesTotalCount;i++){
                if(stuAssess.equals("")){
                    smallQuesAssess[i] = "";
                }else {
                    smallQuesAssess[i] = Control.returnArray(stuAssess, "$、", 2)[i];
                }
            }

            smallQuesAllAmount = 0;
            for(int i=0;i<totalItemCount;i++){
                smallQuesAllAmount = smallQuesAllAmount + Control.backSum(InforFavoritesPage.getQueList().get(i).getAnswer(),"$、")+1;
            }
            smallQuesScore = score/smallQuesAllAmount;
        }

    }

    /*
   * 获取题目题干信息
   * */
    private void showContent(){

        holder.TvAnswerAmount.setText("本题包含"+totalItemCount+"个小题");

//        holder.TvItemIndex.setText("("+itemIndex+")");

//        String arrayContent[] = new String[Control.backSum(itemContent,"____")+1];
//        String contentAll = "";
//        for(int i = 0;i<Control.backSum(itemContent,"____")+1;i++) {
//            arrayContent[i] = Control.returnArray(itemContent, "____", 4)[i];
//            if(i<Control.backSum(itemContent,"____")) {
//                contentAll = contentAll + arrayContent[i] + "<font color='#3399cc'><middle><middle><U>"+"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+"（"+(i+1)+"）"+"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</U></middle></middle></font>";
//            }else{
//                contentAll = contentAll + arrayContent[i];
//            }
//        }
//        itemContent = StringEscapeUtils.unescapeXml(contentAll);
//        holder.WvContent.loadDataWithBaseURL("about:blank",itemContent,"text/html","utf-8",null);

        itemContent = StringEscapeUtils.unescapeXml("("+itemIndex+")"+itemContent);
//        holder.TvItemContent.setText(Html.fromHtml(itemContent));
        holder.WvContent.loadDataWithBaseURL("about:blank",itemContent,"text/html","utf-8",null);
        holder.WvContent.getSettings().setDefaultFontSize(18);

    }


    private TktAnswerEditText[] TktAnswerEdt;
    /*
    * 用户作答
    * */
    private void setEdtStuAnswer(){

        TktAnswerEdt = new TktAnswerEditText[SmallQuesTotalCount];
        for(int i=0;i<SmallQuesTotalCount;i++){
            TktAnswerEdt[i] = new TktAnswerEditText(mContext);

            Log.e("==stuAnswer===","======"+smallQuesStuAnswer[i]);
            if(smallQuesStuAnswer[i].equals("")){
                TktAnswerEdt[i].EdtStuAnswer.setHint("请在这里输入答案...");
            }else{
                TktAnswerEdt[i].EdtStuAnswer.setText(smallQuesStuAnswer[i]);
            }

            TktAnswerEdt[i].TvStuAnswerIndex.setText(String.valueOf(i+1)+".");
            final int finalI = i;
            TktAnswerEdt[i].EdtStuAnswer.addTextChangedListener(new TextWatcher() {
                @Override
                public void beforeTextChanged(CharSequence s, int start, int count, int after) {

                }

                @Override
                public void onTextChanged(CharSequence s, int start, int before, int count) {

                }

                @Override
                public void afterTextChanged(Editable s) {
                    setIntoStuAnswer(s.toString(), finalI);
                }
            });
            holder.LayoutStuAnswerEdt.addView( TktAnswerEdt[i]);
        }
    }


    private TextView[] TvStuAnswer;
    private TextView[] TvAnswer;
    private TextView[] TvAssess;
    /*
    * 显示试题解析回看信息
    * */
    private void showAnalysis(){

        TvStuAnswer = new TextView[SmallQuesTotalCount];
        TvAnswer = new TextView[SmallQuesTotalCount];
        TvAssess = new TextView[SmallQuesTotalCount];

        if((PaperID==1&&(ModelFrom==PaperDef.FROM_BASE_REVIEW_WRONG||ModelFrom==PaperDef.FROM_DIFFERENT_REVIEW_WRONG))||
                ModelFrom==PaperDef.FROM_FAVOURITE_REVIEW){
            holder.LayoutStuAnswerEdt.setVisibility(View.GONE);
            holder.LayoutAnalysis.setVisibility(View.GONE);
            holder.LayoutClassicExample.setVisibility(View.VISIBLE);

            holder.LayoutClassic.setVisibility(View.VISIBLE);
//            answer = StringEscapeUtils.unescapeXml(answer);
//            holder.TvClassicAnswer.setText(Html.fromHtml(answer));
            for(int i=0;i<SmallQuesTotalCount;i++){
                TvAnswer[i] = new TextView(mContext);
                TvAnswer[i].setTextColor(tvGreen);
                smallQueAnswer[i] = smallQueAnswer[i].replaceAll("\\$/","/");
                TvAnswer[i].setText(String.valueOf(i+1)+"、"+smallQueAnswer[i]);
                holder.LayoutClassicAnswer.addView( TvAnswer[i]);
            }

            if(analysis.equals("")){
                holder.TvClassicAnalysis.setText("暂无解析");
            }else {
                analysis = StringEscapeUtils.unescapeXml(analysis);
                holder.TvClassicAnalysis.setText(Html.fromHtml(analysis));
            }

        }else{

            if(state==2 ||(PaperID==0&&ModelFrom==PaperDef.FROM_BASE_REVIEW_WRONG)||
                    (PaperID==0&&ModelFrom==PaperDef.FROM_DIFFERENT_REVIEW_WRONG)) {
                holder.LayoutAnalysis.setVisibility(View.VISIBLE);
                holder.LayoutStuAnswerEdt.setVisibility(View.GONE);
                if (ModelFrom == PaperDef.FROM_GUESS_REVIEW) {
                    holder.LayoutScore.setVisibility(View.VISIBLE);
                } else {
                    holder.LayoutScore.setVisibility(View.GONE);
                }

                /**********************************************************************************/
                /**********************************************************************************/
                double stuScore = 0;
                String strAllSmallQuesStuAnswer = "";
                if(!stuAssess.equals("")) {

                    for(int i=0;i<SmallQuesTotalCount;i++){
                        TvStuAnswer[i] = new TextView(mContext);
                        if(!smallQuesAssess[i].equals("")) {
                            if (smallQuesAssess[i].equals("正确")) {
                                TvStuAnswer[i].setTextColor(tvGreen);
                                stuScore = stuScore+smallQuesScore;
                                strAllSmallQuesStuAnswer = String.valueOf(i+1)+"、"+"系统默认纸面作答";
                            } else if (smallQuesAssess[i].equals("错误")) {
                                TvStuAnswer[i].setTextColor(tvRed);
                                strAllSmallQuesStuAnswer = String.valueOf(i+1)+"、"+"系统默认纸面作答";
                            }else{
                                if(Control.getCorrectRate(Float.valueOf(smallQuesAssess[i]),(float)smallQuesScore)<0.7){
                                    TvStuAnswer[i].setTextColor(tvRed);
                                }else{
                                    TvStuAnswer[i].setTextColor(tvGreen);
                                }
                                stuScore = stuScore+Double.valueOf(smallQuesAssess[i]);
                                strAllSmallQuesStuAnswer = String.valueOf(i+1)+"、"+smallQuesStuAnswer[i];
                            }

                        }else{
                            TvStuAnswer[i].setTextColor(tvRed);
                            strAllSmallQuesStuAnswer = String.valueOf(i+1)+"、"+"未作答";
                        }
                        if(smallQuesStuAnswer[i].equals("")) {
                            TvStuAnswer[i].setText(strAllSmallQuesStuAnswer);
                        }else{
                            for(int k=0;k<Control.backSum(smallQueAnswer[i],"$/")+1;k++) {
                                if (smallQuesStuAnswer[i].trim().equals(Control.returnArray(smallQueAnswer[i], "$/", 2)[k])) {
                                    TvStuAnswer[i].setTextColor(tvGreen);
                                    if (smallQuesAssess[i].equals("")) {
                                        stuScore = stuScore + smallQuesScore;
                                    }
                                    break;
                                } else {
                                    TvStuAnswer[i].setTextColor(tvRed);
                                }
                            }
                            TvStuAnswer[i].setText(String.valueOf(i+1)+"、"+smallQuesStuAnswer[i]);
                        }
                        holder.LayoutStuAnswer.addView(TvStuAnswer[i]);

                    }
                }else{
                    for(int i=0;i<SmallQuesTotalCount;i++){
                        TvStuAnswer[i] = new TextView(mContext);
                        for(int k=0;k<Control.backSum(smallQueAnswer[i],"$/")+1;k++){
                            Log.e("=====KKKKK====88888===",smallQuesStuAnswer[i]);
                            if(!smallQuesStuAnswer[i].equals("")){
                                if (smallQuesStuAnswer[i].trim().equals(Control.returnArray(smallQueAnswer[i],"$/",2)[k])) {
                                    TvStuAnswer[i].setTextColor(tvGreen);
                                    if(smallQuesAssess[i].equals("")) {
                                        stuScore = stuScore + smallQuesScore;
                                    }
                                    strAllSmallQuesStuAnswer = String.valueOf(i+1)+"、"+smallQuesStuAnswer[i];
                                    break;
                                }else{
                                    TvStuAnswer[i].setTextColor(tvRed);
                                    strAllSmallQuesStuAnswer = String.valueOf(i+1)+"、"+smallQuesStuAnswer[i];
                                }

                            }else{
                                TvStuAnswer[i].setTextColor(tvRed);
                                strAllSmallQuesStuAnswer = String.valueOf(i+1)+"、"+"未作答";
                                Log.e("=====KKKKK====111111===",strAllSmallQuesStuAnswer);
                            }

                        }

                        TvStuAnswer[i].setText(strAllSmallQuesStuAnswer);
                        holder.LayoutStuAnswer.addView(TvStuAnswer[i]);
                    }
                }
                if(stuScore==0){
                    holder.TvScore.setText("0分");
                }else {
                    holder.TvScore.setText(String.valueOf(stuScore) + "分");
                }
                /**********************************************************************************/
                /**********************************************************************************/

                for(int i=0;i<SmallQuesTotalCount;i++){
                    TvAnswer[i] = new TextView(mContext);
                    TvAnswer[i].setTextColor(tvGreen);
                    smallQueAnswer[i] = smallQueAnswer[i].replaceAll("\\$/","/");
                    TvAnswer[i].setText(String.valueOf(i+1)+"、"+smallQueAnswer[i]);
                    holder.LayoutAnswer.addView( TvAnswer[i]);
                }


                if(analysis.equals("")){
                    analysis = "暂无解析";
                }
                analysis = StringEscapeUtils.unescapeXml(analysis);
                holder.TvAnalysis.setText(Html.fromHtml(analysis));


                for(int i=0;i<SmallQuesTotalCount;i++){
                    TvAssess[i] = new TextView(mContext);
                    TvAssess[i].setTextColor(tvBlue);
                    if(smallQuesAssess[i].equals("")){
                        TvAssess[i].setText(String.valueOf(i+1)+"、"+"未自评");
                    }else{
                        if(ModelFrom==PaperDef.FROM_GUESS_REVIEW) {
                            TvAssess[i].setText(String.valueOf(i+1)+"、"+smallQuesAssess[i]+"分");
                        }else{
                            TvAssess[i].setText(String.valueOf(i+1)+"、"+smallQuesAssess[i]);
                        }
                    }
                    holder.LayoutAssess.addView( TvAssess[i]);
                }

            }else{
                holder.LayoutStuAnswerEdt.setVisibility(View.VISIBLE);
                holder.LayoutAnalysis.setVisibility(View.GONE);
            }

            holder.LayoutClassicExample.setVisibility(View.GONE);
        }

    }

    /*
    * 写入作答信息
    * */
    private void setIntoStuAnswer(String strStuAnswer,int currentEdt){
        if(ModelFrom== PaperDef.FROM_BASE_REVIEW) {
            String smallQuesAllStuAnswer = "";
            smallQuesStuAnswer[currentEdt] = strStuAnswer;
            for(int i=0;i<SmallQuesTotalCount;i++){
                if(i==0){
                    smallQuesAllStuAnswer=smallQuesStuAnswer[0];
                }else{
                    smallQuesAllStuAnswer = smallQuesAllStuAnswer + "$、" + smallQuesStuAnswer[i];
                }
            }
            InforBasicReview.getPaperContent().get(PaperID).getQueList().get(OptionID).setStuAnswer(smallQuesAllStuAnswer);

            String stuAnswerAll = "";
            String stuAssessAll = "";
//            int totalItemCountTrue = 0;
            String thisStuAnswer = "";
//            String thisAnswer = "";
            String thisStuAssess = "";
            int quesAnsweredItemCount = 0;
            for(int i=0;i<totalItemCount;i++){
                if(i==0){
                    stuAnswerAll = InforBasicReview.getPaperContent().get(PaperID).getQueList().get(i).getStuAnswer();
                    stuAssessAll = InforBasicReview.getPaperContent().get(PaperID).getQueList().get(i).getStuAssess();
                }else{
                    stuAnswerAll = stuAnswerAll+"#$*#"+InforBasicReview.getPaperContent().get(PaperID).getQueList().get(i).getStuAnswer();
                    stuAssessAll = stuAssessAll+"#$*#"+InforBasicReview.getPaperContent().get(PaperID).getQueList().get(i).getStuAssess();
                }
                thisStuAnswer = InforBasicReview.getPaperContent().get(PaperID).getQueList().get(i).getStuAnswer();
//                thisAnswer = InforBasicReview.getPaperContent().get(PaperID).getQueList().get(i).getAnswer();
                thisStuAssess = InforBasicReview.getPaperContent().get(PaperID).getQueList().get(i).getStuAssess();
//                Log.e("=====True====","===="+thisStuAssess);
//                if(!thisStuAssess.equals("")) {
//                    for(int j=0;j<Control.backSum(thisAnswer,"$、")+1;j++){
//                        if(Control.returnArray(thisStuAssess,"$、",2)[j].equals("正确")){
//                            totalItemCountTrue++;
//                        }
//                    }
//                }else {
//                    for(int j=0;j<Control.backSum(thisAnswer,"$、")+1;j++){
//
//                        for(int k=0;k<Control.backSum(Control.returnArray(thisAnswer,"$、",2)[j],"$/")+1;k++) {
//                            if (Control.returnArray(thisStuAnswer, "$、", 2)[j].equals( Control.returnArray(Control.returnArray(thisAnswer,"$、",2)[j],"$/",2)[k])) {
//                                totalItemCountTrue++;
//                            }
//
//                        }
//                    }
//
//                }
//
                if(!thisStuAnswer.equals("")||!thisStuAssess.equals("")){
                    quesAnsweredItemCount++;
                }
//
            }
//
            InforBasicReview.getPaperContent().get(PaperID).setStuAnswerNewAll(stuAnswerAll);
//            Log.e(">>>>>allall9999999>>>>", "==itemContent=="+itemContent+"==AnswerNewAll==9999==:"+ stuAnswerAll);
            InforBasicReview.getPaperContent().get(PaperID).setStuAssessNewAll(stuAssessAll);
//            Log.e("=====True====","===="+totalItemCountTrue);
//            InforBasicReview.getPaperContent().get(PaperID).setCorrectRate(Control.getCorrectRate(Float.valueOf(totalItemCountTrue),Float.valueOf(allSmallQuesItemTotalCount)));
            InforBasicReview.getPaperContent().get(PaperID).setAnsweredItemCount(quesAnsweredItemCount);

        }else if(ModelFrom==PaperDef.FROM_BASE_REVIEW_WRONG||ModelFrom==PaperDef.FROM_DIFFERENT_REVIEW_WRONG){
            String smallQuesAllStuAnswer = "";
            smallQuesStuAnswer[currentEdt] = strStuAnswer;
            for(int i=0;i<SmallQuesTotalCount;i++){
                if(i==0){
                    smallQuesAllStuAnswer=smallQuesStuAnswer[0];
                }else{
                    smallQuesAllStuAnswer = smallQuesAllStuAnswer + "$、" + smallQuesStuAnswer[i];
                }
            }
            Log.e("=====CCCCC===9999===",smallQuesAllStuAnswer);
            InforWrongQues.get(PaperID).getQueList().get(OptionID).setStuAnswer(smallQuesAllStuAnswer);
            int totalItemCount = InforWrongQues.get(PaperID).getTotalItemCount();
            String stuAnswerAll = "";
            String stuAssessAll = "";
//            int totalItemCountTrue = 0;
            String thisStuAnswer = "";
//            String thisAnswer = "";
            String thisStuAssess = "";
            int quesAnsweredItemCount = 0;
            for(int i=0;i<totalItemCount;i++){
                if(i==0){
                    stuAnswerAll = InforWrongQues.get(PaperID).getQueList().get(i).getStuAnswer();
                    stuAssessAll = InforWrongQues.get(PaperID).getQueList().get(i).getStuAssess();
                }else{
                    stuAnswerAll = stuAnswerAll+"#$*#"+InforWrongQues.get(PaperID).getQueList().get(i).getStuAnswer();
                    stuAssessAll = stuAssessAll+"#$*#"+InforWrongQues.get(PaperID).getQueList().get(i).getStuAssess();
                }
                thisStuAnswer = InforWrongQues.get(PaperID).getQueList().get(i).getStuAnswer();
//                thisAnswer = InforWrongQues.get(PaperID).getQueList().get(i).getAnswer();
                thisStuAssess = InforWrongQues.get(PaperID).getQueList().get(i).getStuAssess();
//                if(!thisStuAssess.equals("")) {
//                    if (thisStuAssess.equals("正确")) {
//                        totalItemCountTrue++;
//                    }
//                }else {
//                    if (thisStuAnswer.equals(thisAnswer)) {
//                        totalItemCountTrue++;
//                    }
//                }
//
                if(!thisStuAnswer.equals("")||!thisStuAssess.equals("")){
                    quesAnsweredItemCount++;
                }

            }

            InforWrongQues.get(PaperID).setStuAnswerNewAll(stuAnswerAll);
            InforWrongQues.get(PaperID).setStuAssessNewAll(stuAssessAll);
//            InforWrongQues.get(PaperID).setCorrectRate(Control.getCorrectRate(Float.valueOf(totalItemCountTrue),Float.valueOf(totalItemCount)));
            InforWrongQues.get(PaperID).setAnsweredItemCount(quesAnsweredItemCount);

        }else if(ModelFrom==PaperDef.FROM_DIFFERENT_REVIEW){

            String smallQuesAllStuAnswer = "";
            smallQuesStuAnswer[currentEdt] = strStuAnswer;
            for(int i=0;i<SmallQuesTotalCount;i++){
                if(i==0){
                    smallQuesAllStuAnswer=smallQuesStuAnswer[0];
                }else{
                    smallQuesAllStuAnswer = smallQuesAllStuAnswer + "$、" + smallQuesStuAnswer[i];
                }
            }
            Log.e("=====CCCCC===0000===",smallQuesAllStuAnswer);
            InforDifficultReview.getQueList().get(OptionID).setStuAnswer(smallQuesAllStuAnswer);
            int totalItemCount = InforDifficultReview.getTotalItemCount();
            String stuAnswerAll = "";
            String stuAssessAll = "";
//            int totalItemCountTrue = 0;
            String thisStuAnswer = "";
//            String thisAnswer = "";
            String thisStuAssess = "";
            int quesAnsweredItemCount = 0;
            for(int i=0;i<totalItemCount;i++){
                if(i==0){
                    stuAnswerAll = InforDifficultReview.getQueList().get(i).getStuAnswer();
                    stuAssessAll = InforDifficultReview.getQueList().get(i).getStuAssess();
                }else{
                    stuAnswerAll = stuAnswerAll+"#$*#"+InforDifficultReview.getQueList().get(i).getStuAnswer();
                    stuAssessAll = stuAssessAll+"#$*#"+InforDifficultReview.getQueList().get(i).getStuAssess();
                }
                thisStuAnswer = InforDifficultReview.getQueList().get(i).getStuAnswer();
//                thisAnswer = InforDifficultReview.getQueList().get(i).getAnswer();
                thisStuAssess = InforDifficultReview.getQueList().get(i).getStuAssess();
//                if(!thisStuAssess.equals("")) {
//                    if (thisStuAssess.equals("正确")) {
//                        totalItemCountTrue++;
//                    }
//                }else {
//                    if (thisStuAnswer.equals(thisAnswer)) {
//                        totalItemCountTrue++;
//                    }
//                }
//
                if(!thisStuAnswer.equals("")||!thisStuAssess.equals("")){
                    quesAnsweredItemCount++;
                }

            }

            InforDifficultReview.setStuAnswerNewAll(stuAnswerAll);
            InforDifficultReview.setStuAssessNewAll(stuAssessAll);
//            InforDifficultReview.setCorrectRate(Control.getCorrectRate(Float.valueOf(totalItemCountTrue),Float.valueOf(totalItemCount)));
            InforDifficultReview.setAnsweredItemCount(quesAnsweredItemCount);

        }else if(ModelFrom==PaperDef.FROM_GUESS_REVIEW){
            String smallQuesAllStuAnswer = "";
            smallQuesStuAnswer[currentEdt] = strStuAnswer;
            for(int i=0;i<SmallQuesTotalCount;i++){
                if(i==0){
                    smallQuesAllStuAnswer=smallQuesStuAnswer[0];
                }else{
                    smallQuesAllStuAnswer = smallQuesAllStuAnswer + "$、" + smallQuesStuAnswer[i];
                }
            }
            Log.e("=====CCCCC===1111===",smallQuesAllStuAnswer);
            InforGuessTesting.getPaperContent().get(PaperID).getQueList().get(OptionID).setStuAnswer(smallQuesAllStuAnswer);
            int totalItemCount = InforGuessTesting.getPaperContent().get(PaperID).getTotalItemCount();
            String stuAnswerAll = "";
            String stuAssessAll = "";
//            int totalItemCountTrue = 0;
            String thisStuAnswer = "";
//            String thisAnswer = "";
            String thisStuAssess = "";
            int quesAnsweredItemCount = 0;
            for(int i=0;i<totalItemCount;i++){
                if(i==0){
                    stuAnswerAll = InforGuessTesting.getPaperContent().get(PaperID).getQueList().get(i).getStuAnswer();
                    stuAssessAll = InforGuessTesting.getPaperContent().get(PaperID).getQueList().get(i).getStuAssess();
                }else{
                    stuAnswerAll = stuAnswerAll+"#$*#"+InforGuessTesting.getPaperContent().get(PaperID).getQueList().get(i).getStuAnswer();
                    stuAssessAll = stuAssessAll+"#$*#"+InforGuessTesting.getPaperContent().get(PaperID).getQueList().get(i).getStuAssess();
                }
                thisStuAnswer = InforGuessTesting.getPaperContent().get(PaperID).getQueList().get(i).getStuAnswer();
//                thisAnswer = InforGuessTesting.getPaperContent().get(PaperID).getQueList().get(i).getAnswer();
                thisStuAssess = InforGuessTesting.getPaperContent().get(PaperID).getQueList().get(i).getStuAssess();
//                if(!thisStuAssess.equals("")) {
//                    if (thisStuAssess.equals("正确")) {
//                        totalItemCountTrue++;
//                    }
//                }else {
//                    if (thisStuAnswer.equals(thisAnswer)) {
//                        totalItemCountTrue++;
//                    }
//                }
//
                if(!thisStuAnswer.equals("")||!thisStuAssess.equals("")){
                    quesAnsweredItemCount++;
                }

            }

            InforGuessTesting.getPaperContent().get(PaperID).setStuAnswerNewAll(stuAnswerAll);
            InforGuessTesting.getPaperContent().get(PaperID).setStuAssessNewAll(stuAssessAll);
//            InforGuessTesting.getPaperContent().get(PaperID).setCorrectRate(Control.getCorrectRate(Float.valueOf(totalItemCountTrue),Float.valueOf(totalItemCount)));
            InforGuessTesting.getPaperContent().get(PaperID).setAnsweredItemCount(quesAnsweredItemCount);
        }
    }

    /*********************************************************************************************************/
    /*********************************************************************************************************/
    /**************************************************************************************************/
    /**************************************************************************************************/

    private class clickListener implements View.OnClickListener {
        public void onClick(View v) {
            if (holder.LayoutClassic.getVisibility() == GONE) {
                animationIvOpen();
                holder.LayoutClassic.setVisibility(View.VISIBLE);
            } else {
                animationIvClose();
                holder.LayoutClassic.setVisibility(View.GONE);
            }
        }
    }

    private void animationIvOpen() {
        RotateAnimation animation = new RotateAnimation(0, 180,
                Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
                0.5f);
        animation.setFillAfter(true);
        animation.setDuration(100);
        holder.IvClassic.startAnimation(animation);
    }

    private void animationIvClose() {
        RotateAnimation animation = new RotateAnimation(180, 0,
                Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
                0.5f);
        animation.setFillAfter(true);
        animation.setDuration(100);
        holder.IvClassic.startAnimation(animation);
    }
    /*********************************************************************************************************/
    /*********************************************************************************************************/
}